<?php

/**
 * Created by Sublime.
 * User: yinni
 * Date: 2017/09/23
 * Time: 16:33
 */
namespace App\Http\Controllers\Admin\Coring;

use Log;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Services\Admin\CoringService;
use App\Http\Requests\Admin\UserRequest;
use \App\Http\Controllers\Admin\BaseController;

/**
 * 实时监测动态回路数据
 * Class CoringController
 * @package App\Http\Controllers\Admin\Coring
 */
class CoringController extends BaseController
{
    protected $service;

    public function __construct(CoringService $service)
    {
        parent::__construct();
        $this->service = $service;
    }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $result = $this->service->index();
        return request()->ajax() ? $result : view('themes.admin.coring.index')->with($result);
    }

    public function alltimeinfo() {
        $alltime_data = $this->service->ajaxData();
                    // dump($res_tpl);die;
        // $json_alltime_data = responce()->json($alltime_data);
        // dump($alltime_data);die;
        // Log::info('错误提示信息');
        // die();
        return $alltime_data;
    }

    // 获取测点位置以及数目信息
    public function getManagerDevices() {
        $res = $this->service->getManagerDevices();
        // dump($res);die;
        return $res;
    }



}